<?xml version="1.0" encoding="UTF-8"?>
<html xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:ui="urn:uuid:user-interface-patterns#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events">    
    <head>        
        <title>Editing Atom Entry</title>
        <link href="atom.css" rel="stylesheet"/>        
        <xf:model>
            <xf:submission action="/atompp/comments/" indent="true" ref="instance('entry')" method="post" id="submitAtom"/>
            <xf:instance src="empty.atom" id="entry"/>
            <xf:instance id="dateParts">
              <parts xmlns="">
                <publishedParts>
                  <date/>
                  <time>HH:MM:SS</time>
                </publishedParts>
                <updatedParts>
                  <date/>
                  <time>HH:MM:SS</time>
                </updatedParts>
              </parts>              
            </xf:instance>
            <xf:bind nodeset="instance('entry')/atom:published" type="xsd:date"/>
            <xf:bind nodeset="instance('entry')/atom:updated" type="xsd:date"/>          
            <xf:bind nodeset="instance('dateParts')/publishedParts">
              <xf:bind nodeset="date" type="xsd:date" id="publishedDate"/>
              <xf:bind nodeset="time" id="publishedTime"/>                
            </xf:bind>
            <xf:bind nodeset="instance('dateParts')/updatedParts">
              <xf:bind nodeset="date" type="xsd:date" id="updatedDate"/>
              <xf:bind nodeset="time" id="updatedTime"/>                
            </xf:bind>
            <xf:bind nodeset="instance('entry')/atom:published" calculate="concat(instance('dateParts')/publishedParts/date,'T',instance('dateParts')/publishedParts/time)"/>
            <xf:bind nodeset="instance('entry')/atom:updated" calculate="concat(instance('dateParts')/updatedParts/date,'T',instance('dateParts')/updatedParts/time)"/>          
        </xf:model>            
     </head>
    <body>
        <h1>Editing Atom Feed</h1>
        <fieldset><legend/><xf:group ref="instance('entry')">
                <fieldset><legend><xf:output value="concat(atom:title,'(',instance('entry')/atom:published,'/',instance('entry')/atom:updated,')')"/></legend><table><tbody><tr><xhtml:td width="10%"><span style="font-weight:bold;">Title</span></xhtml:td><xhtml:td width="90%"><xf:input ref="atom:title"/></xhtml:td></tr><tr><xhtml:td width="10%"><span style="font-weight:bold;">Identifier</span></xhtml:td><xhtml:td width="90%"><xf:input ref="atom:id"/></xhtml:td></tr><tr><xhtml:td width="10%"><span style="font-weight:bold;">Updated</span></xhtml:td><xhtml:td width="90%"><xf:group>                                  
                                  <xf:input ref="instance('dateParts')/updatedParts/date"/>
                                  <span class="bold">T</span>
                                  <xf:input ref="instance('dateParts')/updatedParts/time"/>
                                </xf:group></xhtml:td></tr><tr><xhtml:td width="10%"><span style="font-weight:bold;">Published</span></xhtml:td><xhtml:td width="90%"><xf:group>                                  
                                <xf:input ref="instance('dateParts')/publishedParts/date"/>
                                <span class="bold">T</span>
                                <xf:input ref="instance('dateParts')/publishedParts/time"/>
                              </xf:group></xhtml:td></tr><tr><xhtml:td width="10%"><span style="font-weight:bold;">Link(s)</span></xhtml:td><xhtml:td width="90%"><xf:repeat nodeset="atom:link"><xf:group ref="."><xf:input ref="@rel"><xf:label>Relation</xf:label></xf:input><xf:input ref="@href" class="url"><xf:label>URL</xf:label></xf:input></xf:group></xf:repeat><xf:trigger><xf:label>Add ..</xf:label><xf:action ev:event="DOMActivate"><xf:insert position="after" nodeset="atom:link" at="1"/></xf:action></xf:trigger></xhtml:td></tr><tr><xhtml:td width="10%"><span style="font-weight:bold;">Author</span></xhtml:td><xhtml:td width="90%"><xf:input ref="atom:author/atom:name"/></xhtml:td></tr><tr><xhtml:td width="10%"><span style="font-weight:bold;">Category(ies)</span></xhtml:td><xhtml:td width="90%"><xf:repeat nodeset="atom:category"><xf:group ref="."><xf:input ref="@scheme" class="url"><xf:label>Scheme</xf:label></xf:input><xf:input ref="@term"><xf:label>Term</xf:label></xf:input></xf:group></xf:repeat><xf:trigger><xf:label>Add ..</xf:label><xf:action ev:event="DOMActivate"><xf:insert position="after" nodeset="atom:category" at="1"/></xf:action></xf:trigger></xhtml:td></tr></tbody></table></fieldset>
                <xf:textarea ref="atom:content"/>
            </xf:group></fieldset>        
    </body>
</html>